import java.time.LocalDate;
import java.util.Calendar;

public class Test5 {
    public static void main(String[] args) {



        /*JDK7*/
        Calendar c = Calendar.getInstance();
        c.set(2000, 2, 1);
        c.add(Calendar.DAY_OF_MONTH, -1);
        int day = c.get(Calendar.DAY_OF_MONTH);
        System.out.println(day);
        if (day == 28) {
            System.out.println("是平年");

        } else {
            System.out.println("是闰年");
        }


        /*JDK8*/
        LocalDate ld = LocalDate.of(2000, 3, 1);
        LocalDate ld2 = ld.minusDays(1);
        System.out.println(ld2.getDayOfMonth());
        int day2 = ld2.getDayOfMonth();
        if (day2 == 28) {
            System.out.println("是平年");

        } else {
            System.out.println("是闰年");
        }


        System.out.println(ld.isLeapYear());


    }
}
